package com.shopx.auth.service;

import com.alibaba.fastjson.JSONArray;
import com.shopx.auth.bean.SysUrl;
import com.shopx.auth.model.SysUrlModel;
import com.shopx.base.exception.ShopxException;
import com.shopx.cmm.DTO.PageDTO;

import java.util.List;

/**
 * @author lituo
 * @className: ISysUrlService
 * @description: 菜单
 * @date 2021/12/5 10:42 AM
 */
public interface ISysUrlService {

  /**
   * 新增记录
   *
   * @param sysUrl
   * @return int
   * @author lituo
   * @date 3:20 PM 2021/12/5
   */
  int insertSelective(SysUrl sysUrl) throws ShopxException;

  /**
   * 删除记录
   *
   * @param sysUrl
   * @return int
   * @author lituo
   * @date 3:20 PM 2021/12/5
   */
  int deleteByPrimaryKey(SysUrl sysUrl) throws ShopxException;

  /**
   * 删除选择菜单
   * @param sysUrl
   * @throws ShopxException
   */
  void deleteChkIds(SysUrlModel sysUrl) throws ShopxException;

  /**
   * 查询明细记录
   *
   * @param sysUrl
   * @return com.shopx.auth.model.SysUrlModel
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  SysUrlModel selectByPrimaryKey(SysUrl sysUrl) throws ShopxException;

  /**
   * 修改记录
   *
   * @param sysUrl
   * @return int
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  int updateByPrimaryKeySelective(SysUrl sysUrl) throws ShopxException;

  /**
   * 分页查询
   *
   * @param sysUrlModel
   * @return com.shopx.cmm.dto.PageDTO<com.shopx.auth.model.SysUrlModel>
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  PageDTO<SysUrlModel> getListPage(SysUrlModel sysUrlModel) throws ShopxException;

  /**
   * 查询列表
   *
   * @param record
   * @return java.util.List<com.shopx.auth.model.SysUrlModel>
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  List<SysUrlModel> selectList(SysUrlModel record) throws ShopxException;

  /**
   * 创建根目录
   *
   * @param
   * @return com.shopx.auth.model.SysUrlModel
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  SysUrlModel createRoot() throws ShopxException;

  /**
   * 查询单个url信息
   *
   * @param url
   * @return com.shopx.auth.model.SysUrlModel
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  SysUrlModel selectOne(SysUrlModel url) throws ShopxException;

  /**
   * 获取用户所有菜单
   *
   * @param urlType
   * @return java.util.List<com.shopx.auth.model.SysUrlModel>
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  List<SysUrlModel> getUrlByUserId(String userId,String urlType,String cpId) throws ShopxException;

  /**
    * 获取当前登录用户可访问菜单
    * @author lituo
    * @date 5:55 PM 2022/1/9
    * @param
    * @return java.util.List<com.shopx.auth.model.SysUrlModel>
    */
  List<SysUrlModel> getCurUserUrl() throws ShopxException;

  /**
   * 获取用户所有菜单
   *
   * @param urlType
   * @return com.alibaba.fastjson.JSONArray
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  JSONArray getUrlJsonByUserId(String userId,String urlType,String cpId) throws ShopxException;

  /**
   * 查询角色对应菜单
   *
   * @param sysUrlModel
   * @return int
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  int selectRoleHaveUrl(SysUrlModel sysUrlModel) throws ShopxException;

  /**
   * 查询父菜单节点下所有的子节点
   *
   * @param parUrlId
   * @return java.util.List<com.shopx.auth.model.SysUrlModel>
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  List<SysUrlModel> queryParUrlNodeList(String parUrlId) throws ShopxException;

  /**
   * 查询父菜单下子菜单
   *
   * @param parUrlId
   * @return java.util.List<com.shopx.auth.model.SysUrlModel>
   * @author lituo
   * @date 3:21 PM 2021/12/5
   */
  String queryUrlNodeList(String parUrlId) throws ShopxException;

  /**
   * 获取编辑树（选中节点默认勾选）
   * @param sysUrlModel
   * @return
   * @throws ShopxException
   */
  String queryEditUrlNodeList(SysUrlModel sysUrlModel) throws ShopxException;


}

